package com.yzh.wanandroid.utils.binding

import android.text.TextUtils
import com.yzh.wanandroid.network.retrofit.responsebean.Tag

fun getChapter(superChapterName: String, chapterName: String): String {
    return when {
        superChapterName.isNotEmpty() and chapterName.isNotEmpty() ->
            "${superChapterName} / ${chapterName}"
        superChapterName.isNotEmpty() -> superChapterName
        chapterName.isNotEmpty() -> chapterName
        else -> ""
    }
}

fun getName(name : List<Tag>) :String {
    if (name.isEmpty()) {
        return ""
    } else {
        if (TextUtils.isEmpty(name[0].name)) {
            return ""
        }
        return name[0].name
    }
}